In accordance with the NTSC (National Television Standards Committee) and PAL (Phase Alternating Line) standard, video images are presented in the YUV color space. The Y signal represents a luminance value while the U and V signals represent color difference or chrominance values. YUV video image data may be transmitted in packed format or planar format. In packed format, all the data for a given set of pixels of the video image is transmitted before any data for another set of pixels is transmitted. As a result, in packed format, YUV data is interleaved in the transmitted pixel data stream 100, as depicted in FIG. 1 (YUY2 packed format). In planar format, Y, U and V data values are stored into separate Y, U and V memory areas (planes) in system memory 110, as depicted in FIG. 1B.
FIGS. 2A, 2B and 2C are diagrams illustrating three different formats for representing video images in the YUV color space. A video image frame may consist of three rectangular matrices representing the luminance Y and the two-chrominance values U and V. Y matrices 120, 130 and 140 have an even number of rows and columns. In YUV 4:2:0 color space format, chrominance component matrices 122 and 124 may be one half in size of Y matrix 120 in horizontal and vertical directions as depicted in FIG. 2A. In YUV 4:2:2 format, chrominance component matrices 132 and 134 may be one half in size of Y matrix 130 in the horizontal direction and the same size in the vertical direction as depicted in FIG. 2B. Finally, in YUV 4:4:4 format, chrominance component matrices 142 and 144 may be the same size as Y matrix 140 in the horizontal and vertical directions as depicted in FIG. 2C.
To store video data efficiently, conventional digital video systems contain a data compressor that compresses the video image data using compression techniques. Many conventional compression techniques are based on compressing the video image data by processing the different pixel components separately. For example, in accordance with Motion Picture Experts Group (MPEG) or International Telecommunications Union (ITU) video compression standards, a YUV-data compressor may encode the Y data independently of encoding U data and encoding V data. Such a compressor preferable receives video data in planar format, in which the Y, U, and V data for multiple pixels are separated and grouped together in three distinct data streams of Y only, U only and V only data, as described above (FIG. 1B).
Although planar format provides significant advantages for data compression, several disadvantages arise when storing or processing data received in planar format. For example, a video decoder that receives video image data in YUV planar format requires three pointers to the Y, U and V component values. For basic DVD (Digital Versatile Disk) and HDTV (High Definition Television) mode, each macroblock has three blocks of pixels: Y:16×16, U:8×8 and V:8×8. In addition, the U and V components are located in different memory locations. In terms of code size, three blocks of code are required for conventional motion compensation of the video image data. Moreover, a separate memory page usually must be opened for each YUV component.
In terms of cache efficiency, for YUV video in the 4:2:0 format (FIG. 2A), the useful area (in a cache line) for the Y-component is about sixteen-bytes per cache line. For the U and V components, the useful area is eight-bytes per line per color-component. Therefore, two rows in a macroblock potentially occupy four cache lines since the U and V components are vertically and horizontally sub-sampled in 4:2:0 format (two Y cache lines, one U cache line, and one V cache line). For YUV video in 4:2:2 format (FIG. 2B), six cache lines are required (2 Y cache lines, 2 U cache lines, and 2 V cache lines.) Although YUY2 packed format (FIG. 1A), as described above, uses only two cache lines and could be used to overcome this cache inefficiency problem, conventional motion compensation of data in YUY2 format is inefficient.
Therefore, there remains a need to overcome the limitations in the above described existing art, which is satisfied by the inventive structure and method described hereinafter.